/*
 * Create By: Software Automation Generator
 * Create Time : 2009-2-24 12:00
 * 
 */
namespace Jumpton.SFA.Server.Entity
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Jumpton.Persistent;
    using System.Data;
    using System.Runtime.Serialization;
    
    
    [System.SerializableAttribute()]
    [Map("EventLog")]
    public class EventLog : ObjectRow {
        
        public EventLog() {
        }
        
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">DataTable 中的一行数据</param>
        /// <param name="objectTable">存储当前对象的数据表格</param>
        public EventLog(System.Data.DataRow dataRow, ObjectTable parent) : 
                base(dataRow, parent) {
        }
        
        /// <summary>
        /// 供反序列化使用的构造函数
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected EventLog(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : 
                base(info, context) {
        }
        
        [Key("LogGUID")]
        public string LogGUID {
            get {
                return (System.String)GetValue("LogGUID");
            }
            set {
                SetValue("LogGUID", value);
            }
        }
        
        [Field("LogTypeKey")]
        public string LogTypeKey {
            get {
                return (System.String)GetValue("LogTypeKey");
            }
            set {
                SetValue("LogTypeKey", value);
            }
        }
        
        [Field("LogConfigID")]
        public decimal LogConfigID {
            get {
                return (System.Decimal)GetValue("LogConfigID");
            }
            set {
                SetValue("LogConfigID", value);
            }
        }
        
        [Field("LogUserID")]
        public String LogUserID
        {
            get {
                return (System.String)GetValue("LogUserID");
            }
            set {
                SetValue("LogUserID", value);
            }
        }
        
        [Field("LogUserName")]
        public string LogUserName {
            get {
                return (System.String)GetValue("LogUserName");
            }
            set {
                SetValue("LogUserName", value);
            }
        }
        
        [Field("LogPortalID")]
        public decimal LogPortalID {
            get {
                return (System.Decimal)GetValue("LogPortalID");
            }
            set {
                SetValue("LogPortalID", value);
            }
        }
        
        [Field("LogPortalName")]
        public string LogPortalName {
            get {
                return (System.String)GetValue("LogPortalName");
            }
            set {
                SetValue("LogPortalName", value);
            }
        }

        /// <summary>
        /// 日志内容
        /// </summary>
        [Field("LogContent")]
        public string Content
        {
            get
            {
                return (System.String)GetValue("Content");
            }
            set
            {
                SetValue("Content", value);
            }
        }
        
        
        [Field("LogCreateDate")]
        public System.DateTime LogCreateDate {
            get {
                return (System.DateTime)GetValue("LogCreateDate");
            }
            set {
                SetValue("LogCreateDate", value);
            }
        }
        
        [Field("LogServerName")]
        public string LogServerName {
            get {
                return (System.String)GetValue("LogServerName");
            }
            set {
                SetValue("LogServerName", value);
            }
        }
        
        [Field("LogProperties")]
        public string LogProperties {
            get {
                return (System.String)GetValue("LogProperties");
            }
            set {
                SetValue("LogProperties", value);
            }
        }
        
        [Field("LogNotificationPending")]
        public bool LogNotificationPending {
            get {
                return (System.Boolean)GetValue("LogNotificationPending");
            }
            set {
                SetValue("LogNotificationPending", value);
            }
        }
        [CalculateField]
        public EventLogTypes eventLogTypes
        {
            get
            {
                EventLogTypes eventLogTypes = null;
                if (GetValue("LogTypeKey") != DBNull.Value)
                {
                    eventLogTypes = ObjectRow.Load(typeof(EventLogTypes), "LogTypeKey='" + GetValue("LogTypeKey").ToString() + "'") as EventLogTypes;

                }
                return eventLogTypes;
            }
        }

    }
}
